package com.pubinfo.passbook.common.service.aviator;

import java.math.BigDecimal;
import java.util.Map;

public interface AviatorScriptService {
  /**
   * 根据公式，进行数学计算，返回计算结果
   * @param equation
   * @return
   */
  BigDecimal execute(String equation, String cacheKey, Map<String, Object> env);
  BigDecimal execute(String equation, Map<String, Object> env);
  /**
   * 如果计算结果为负数，则设置为零
   *
   * @param equation
   * @param env
   * @return
   */
  BigDecimal executeNotNegativeNumber(String equation, Map<String, Object> env);
  Boolean validate(String equation);
}
